package com.xu.controller.center;

import com.xu.pojo.Users;
import com.xu.service.UserService;
import com.xu.service.center.CenterUserService;
import com.xu.utils.JSONResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author anan
 * @create 2022-03-03 18:45
 */

@RestController
@RequestMapping("center")
@Api(value = "cennter - 用户中心", tags = "用户中心展示的相关接口")
public class CenterController {

    @Autowired
    private CenterUserService centerUserService;

    @ApiOperation(value = "获取用户信息", notes = "获取用户信息\"", httpMethod = "GET")
    @GetMapping("/userInfo")
    public JSONResult userInfo(
            @ApiParam(name = "userId", value = "用户id", required = true)
            @RequestParam String userId){
        Users users = centerUserService.queryUserInfo(userId);
        return JSONResult.ok(users);
    }



}
